<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- <style>
      p {
        overflow: hidden;
        line-height: 40px;
        width: 400px;
        height: 40px;
        border: 1px solid red;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    </style>
    <p>sdchjsdbvjkbbbbbbbbbbbbbbbbbbdjksbvjkds读书读死书也等于零</p> -->
    <style>
      .demo {
        position: relative;
        line-height: 20px;
        height: 40px;
        width: 130px;
        overflow: hidden;
      }
      .demo::after {
        content: "...";
        position: absolute;
        bottom: 0;
        right: 0;
        padding: 0 20px 0 10px;
      }
    </style>
    <body>
      <div class="demo">读书读死书也等于零，最重要的还是活学活用</div>
    </body>
  </body>
</html>
